import QtQuick 2.15
import QtQuick.Controls 2.15
import org.ukui.timer 1.0

ApplicationWindow {
    visible: true
    width: 300
    height: 200
    title: qsTr("Timer")

    Column {
        anchors.centerIn: parent
        spacing: 10

        Text {
            id: timeDisplay
            text: timer.elapsedTime + " s"
            font.pixelSize: 24
        }

        Button {
            text: timer.running ? qsTr("Stop") : qsTr("Start")
            onClicked: {
                if (timer.running) {
                    timer.stop()
                } else {
                    timer.start()
                }
            }
        }
    }

    Timer {
        id: timer
        onElapsedTimeChanged: {
            timeDisplay.text = timer.elapsedTime + " s"
        }
    }
}